package com.arpa.wms.mapper;


import com.arpa.wms.domain.dto.BatchRuleDTO;
import com.arpa.wms.domain.entity.BatchRule;
import com.arpa.wms.domain.vo.BatchRuleVO;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 批次规则 Mapper 接口
 * </p>
 *
 * @author LEO
 * @since 2020-08-11
 */
public interface BatchRuleMapper extends BaseMapper<BatchRule> {

    /**
     * 查询列表
     * @param batchRuleDTO
     * @return
     */
    List<BatchRuleVO> queryList(BatchRuleDTO batchRuleDTO);

    List<BatchRuleVO> queryByCodes(@Param("list") List<String> list,@Param("groupCode") String groupCode);

    /**
     * 查询合计,包含总数
     * @param batchRuleDTO
     * @return
     */
    BatchRuleVO queryListSum(BatchRuleDTO batchRuleDTO);

    BatchRuleVO findVoByreceiveItemCode(@Param("receiveItemCode")String receiveItemCode,@Param("groupCode") String groupCode);

    /**
     * 获取使用该批次规则的商品数量
     * @param codes 批次规则标识
     * @return
     */
    List<Map<String,Integer>> goodsUseCount(@Param("codes") List<String> codes);

    BatchRuleVO findVoByGoods(String goodCode);
}
